﻿#ifndef XRTDATAIO_GLOBALEXPORT_H
#define XRTDATAIO_GLOBALEXPORT_H

#if defined(XRTDATAIO_GLOBAL_LIBRARY)
#  define XRTDATAIOSHARED_GLOBALEXPORT Q_DECL_EXPORT
#else
#  define XRTDATAIOSHARED_GLOBALEXPORT Q_DECL_IMPORT
#endif

#include <QtCore>
#include <QtGui>

#include "../db_h/DBDEFINE.h"

extern  "C"
{
	#define		CHECKE_USER_SYSTEMLOGIN_ONLY	0x1000			//只检查系统登录用户权限
	#define		CHECKE_USER_BYGROUP				0x0100			//检查用户组
	#define		CHECKE_USER_BYPRIVILEGE			0x0010			//检查用户权限
	#define		CHECKE_USER_SYSTEMLOGIN			0x0001			//检查系统登录用户权限
	XRTDATAIOSHARED_GLOBALEXPORT		bool		bHavePrivilege(rOperator_Info &rOperatorInfo		//返回用户信息
		, XUINT nUserPrivilege										//检查用户权限或用户组的
		, XUINT nCheckSytemOrGroup=(CHECKE_USER_SYSTEMLOGIN|CHECKE_USER_BYPRIVILEGE)			//检查方式 
		, QWidget *parentWidget=0									//父窗体
		, const char *szInfo = 0									//操作信息
		, const char *szDemo = 0);									//提示信息
}
	//Sample 权限
	/*

	rOperator_Info rOperatorInfo;
	XUINT  nUserPrivilege = USER_PERMIS_WF_SYS_MAINTAIN;
	XUINT nCheckSytemOrGroup=(CHECKE_USER_SYSTEMLOGIN|CHECKE_USER_BYPRIVILEGE);
	const char *szInfo = "进入五防模式";
	const char *szDemo = "用户需要五防系统维护权限";
	bool bRet = bHavePrivilege(rOperatorInfo, nUserPrivilege, nCheckSytemOrGroup, this, szInfo, szDemo);
	if( bRet &&  (rOperatorInfo.ID>0) )
	{

	}
	else
	{
		return false;
	}
	*/

#endif 	//XRTDATAIO_GLOBALEXPORT_H